// 评论时间
function getPinglunTime(){
    var month=new Date().getMonth()+1
    month=month<10?'0'+month:month
    var day=new Date().getDate()
    day=day<10?'0'+day:day
    $('.pinglun-time').text(month+'-'+day+' 12:05')
}
getPinglunTime()
$('.scroll-box').myScroll({
    speed: 60, //数值越大，速度越慢
    rowHeight: 65//li的高度
});
<!-- 数字 -->
$('.numberStyle').leoTextAnimate({
    delay:1000, //延时出现时间
    autorun: true, //是否自动运行
    fixed: [',', ':', '.'], //
    start: '0'
});
// 日期选择
$('.date-select-list .date-tab>a').click(function(){
    $(this).addClass('active').siblings('a').removeClass('active')
    if($(this).text()=='日'){
        $(this).parent().siblings('.select-date-box').find('span').text('日期')
        $('#selectDate').removeClass('hd').siblings('input').addClass('hd')
    }
    if($(this).text()=='月'){
        $(this).parent().siblings('.select-date-box').find('span').text('月份')
        $('#selectMonth').removeClass('hd').siblings('input').addClass('hd')
    }
    if($(this).text()=='年'){
        $(this).parent().siblings('.select-date-box').find('span').text('年份')
        $('#selectYear').removeClass('hd').siblings('input').addClass('hd')
    }
})
//选择日
laydate.render({
    elem: '#selectDate', //指定元素
    theme: '#37B866',
    range: true,
    trigger: 'click',
    min: -10,
    max: 0
});
//选择月
laydate.render({
    elem: '#selectMonth', //指定元素
    theme: '#37B866',
    type: 'month',
    range: true,
    trigger: 'click',
});
//选择年
laydate.render({
    elem: '#selectYear', //指定元素
    theme: '#37B866',
    type: 'year',
    range: true,
    trigger: 'click',
});

// 网络评价好中差评占比
function myChart1(id,data) {
    var myChart = echarts.init(document.getElementById(id));
    var color =  ['#9A4CFB', '#4B66C7', '#44D798']

    var seriesData = data.map((item, index) => {
        return {
            name: item.name,
            value: item.value,
        }
    })
    var option = {
        title: {
            text: '景区',
            textStyle: {
                fontSize: 12,
                color: "#fff"
            },
            x: "center"
        },
        series: [
            {
                name: '渠道分析',
                type: 'pie',
                radius: '60%',
                center: ['50%', '50%'],
                data: seriesData,
                color: color,
                labelLine: {
                    normal: {
                        length: 20,
                        length2: 30,
                        lineStyle: {
                            type: 'solid'
                        }
                    }

                },
                label: {
                    normal: {
                        formatter: function (params) {
                            if (params.dataIndex === 0) {
                                return '{color1|' + params.value + '%}' + '\n{black|' + params.name + '}'
                            } else if (params.dataIndex === 1) {
                                return '{color2|' + params.value + '%}' + '\n{black|' + params.name + '}'
                            } else if (params.dataIndex === 2) {
                                return '{color3|' + params.value + '%}' + '\n{black|' + params.name + '}'
                            }
                        },
                        rich: {
                            black: {
                                color: '#666',
                                padding: [5, -28],
                                textAlign: 'left',
                                fontSize: '14px',
                                fontFamily: 'PingFangSC'
                            },
                            color1: {
                                padding: [5, -28],
                                textAlign: 'left',
                                fontWeight: 700,
                                fontFamily: 'PingFangSC',
                                color: '#9A4CFB'
                            },
                            color2: {
                                padding: [5, -28],
                                textAlign: 'left',
                                fontWeight: 700,
                                fontFamily: 'PingFangSC',
                                color: '#4B66C7'
                            },
                            color3: {
                                padding: [5, -28],
                                textAlign: 'left',
                                fontWeight: 700,
                                fontFamily: 'PingFangSC',
                                color: '#44D798'
                            }
                        }
                    }
                },
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    }

    myChart.setOption(option);
}

// 景区评价排行
function myChart2(id,name,val) {
    var myChart = echarts.init(document.getElementById(id));
    option = {
        grid: {
            top:'8%',
            left:'5%',
            right: '5%',
            bottom: '-5%',
            containLabel: true

        },
        tooltip: {
            show: false
        },
        xAxis: {
            show: false
        },
        yAxis: [{
            type: 'category',

            axisTick: {
                show: false
            },
            axisLine: {
                show: false,
            },
            axisLabel: {
                margin:70,
                textStyle: {
                    align:'left',
                    fontSize: 12,
                    color: '#fff'
                },
            },
            data:name
        }, {
            show:false,
            type: 'category',

            axisLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                textStyle: {
                    fontSize: 12,
                    color: '#fff',
                },
            },
            splitArea: {
                show: false
            },
            splitLine: {
                show: false
            },
            data:val
        }, ],
        series: [
            {

                type: 'bar',

                itemStyle: {
                    normal: {
                        show: true,
                        color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                            offset: 0,
                            color: 'rgba(55,184,102,0.3)'

                        }, {
                            offset: 1,
                            color: 'rgba(55,184,102,1)'

                        }]),
                        barBorderRadius: 0,
                        borderWidth: 0,
                        borderColor: '#333',
                    }
                },
                label: {
                    normal: {
                        position: 'right',
                        color:'#fff',
                        show:true,
                        formatter:function(params){
                            return params.value
                        }
                    }
                },
                barWidth: '30%',

                data: val
            }

        ]
    };

    myChart.setOption(option);
}

